﻿@model GameSchoolApplication.Models.Question

@{
    ViewBag.Title = "Nánar um spurningu";
    Layout = "~/Views/Shared/_TeacherMore.cshtml";
}

<h2>Nánar um spurningu</h2>
<section class="TeacherMainContent">
<p>@Html.DisplayFor(model => model.Content)</p>
<table class="IndexTable">
    <caption>Svarmöguleikar</caption>
    @if (Model.Answers.Count == 0)
    { 
        <tr><td>Engir svarmöguleikar, er ekki krossaspurning.</td></tr>
    }
    else
    { 
        <tr>
            <th>Svar</th>
        </tr>
        foreach (var answer in Model.Answers)
        { 
            <tr>
                <td>@answer.Content</td>
            </tr>
        }
    }
</table>
<p>
    @Html.ActionLink("Bæta við svarmöguleika", "Create", "Answer", new { questionId = Model.QuestionId}, new {}) |
    @Html.ActionLink("Til baka í lista", "Details", "Test", new { id = Model.TestId }, new { })
</p>
</section>